package org.zhucy.design.factory;

/**
 * Created by zcy on 2018/1/25.
 *
 * @version 1.0
 */
public class AbstractFactoryProducer extends AbstractFactory {
    @Override
    People getPeople(String type) {
        switch (type){
            case "S": return (Student) PeopleFactory.getPeople(Student.class);
            case "T":return (Teacher) PeopleFactory.getPeople(Teacher.class);
        }
        return null;
    }

    @Override
    Color getColor(String type) {
        switch (type){
            case "R": return (Red) ColorFactory.getColor(Red.class);
            case "G":return (Green) ColorFactory.getColor(Green.class);
        }
        return null;
    }
}
